package ch3;

import java.util.Scanner;

public class Huangou {

	public static void main(String[] args) {
		System.out.println(
				"1:满50元，加2元换购百事可乐饮料一瓶\n2:满100元，加3元换购500ml可乐1瓶\n3:满100元，加10元换购5公斤面粉\n4:满200元，加10元换购1个苏泊尔炒菜锅\n5:满200元，加20元换购欧莱雅爽肤水一瓶\n0:不换购");

		// 超市购物
		Scanner in = new Scanner(System.in);
		System.out.println("输入购物金额：");
		double money = in.nextInt();
		System.out.print("请选择：");
		int num = in.nextInt();
		switch (num) {
		case 1: {
			if (money >= 50) {
				money += 2;
				System.out.println("本次消费金额：" + money + "\n成功换购：1瓶百事可乐饮料");
			} else {
				System.out.println("不能换购");
			}
			break;
		}
		case 2: {
			if (money >= 100) {
				money += 3;
				System.out.println("本次消费金额：" + money + "\n成功换购：1瓶500ml可乐");
			} else {
				System.out.println("不能换购");
			}
			break;
		}
		case 3: {
			System.out.println("本次消费金额：" + (money + 10) + "\n成功换购：5公斤面粉");
			break;
		}
		case 4: {
			System.out.println("本次消费金额：" + (money + 10) + "\n成功换购：1个苏泊尔炒菜锅");
			break;
		}
		case 5: {
			System.out.println("本次消费金额：" + (money + 20) + "\n成功换购：1瓶欧莱雅爽肤水");
			break;
		}
		case 0: {
			System.out.println("不换购");
			break;
		}
		}

	}
}
